//
// Created by 17775 on 2024/11/1.
//

#ifndef RAYCI_POINTING_STABILITY_VIEW_H
#define RAYCI_POINTING_STABILITY_VIEW_H

#include <QDockWidget>
#include "../../qcustomplot.h"
#include "../../Common/commonchart.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Pointing_Stability_View; }
QT_END_NAMESPACE

class Pointing_Stability_View : public QDockWidget {
Q_OBJECT

signals:
    void stopPointingStabilityThread();
    void reportPointingStability();
    void BeamPointStabilityClicked();

public:
    explicit Pointing_Stability_View(QWidget *parent = nullptr);
    ~Pointing_Stability_View() override;
    void setWindowTitleName(const QString& name);

    void mousePressEvent(QMouseEvent *event);

    QList<CommonChart*> charts = {
            new CommonChart(this),  // XChart
            new CommonChart(this),  // YChart
    };
    void refreshChart();
    void closeEvent(QCloseEvent *event) override;

private:
    Ui::Pointing_Stability_View *ui;
    QWidget* menuPanel = nullptr;
    QVBoxLayout* menuLayout = nullptr;
    QWidget* centralWidget = nullptr;
    QHBoxLayout* mainLayout = nullptr;
    QPushButton* btnSave = nullptr;
    QPushButton* btnExport = nullptr;
    QPushButton* btnZoomReset = nullptr;
    QPushButton* btnCentroidX = nullptr;
    QPushButton* btnCentroidY = nullptr;
    QPushButton* btnCentroidXY = nullptr;
    QPushButton* btnPowerSpectrum = nullptr;
    QPushButton* btnReport = nullptr;
    QSplitter* mainSplitter = nullptr;
    QSplitter* leftSplitter = nullptr;
    QSplitter* rightSplitter = nullptr;
};


#endif //RAYCI_POINTING_STABILITY_VIEW_H
